package cn.veliger.springai.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author veliger
 * create on 2025-07-01
 **/
@NoArgsConstructor
@Data
public class EasyDocParseResult {

    @JsonProperty("data")
    private DataDTO data;
    @JsonProperty("success")
    private Boolean success;

    @NoArgsConstructor
    @Data
    public static class DataDTO {
        @JsonProperty("task_id")
        private String taskId;
        @JsonProperty("task_result")
        private TaskResultDTO taskResult;
        @JsonProperty("task_status")
        private String taskStatus;

        @NoArgsConstructor
        @Data
        public static class TaskResultDTO {
            @JsonProperty("file_name")
            private String fileName;
            @JsonProperty("blocks")
            private List<BlocksDTO> blocks;

            @NoArgsConstructor
            @Data
            public static class BlocksDTO {
                @JsonProperty("block_id")
                private Integer blockId;
                @JsonProperty("type")
                private String type;
                @JsonProperty("text")
                private String text;
                @JsonProperty("page_number")
                private Integer pageNumber;
                @JsonProperty("coordinates")
                private List<Double> coordinates;
                @JsonProperty("system")
                private String system;
                @JsonProperty("layout_width")
                private Integer layoutWidth;
                @JsonProperty("layout_height")
                private Integer layoutHeight;
            }
        }
    }
}
